To punish someone so as to give a warning to others.
He made an example of the drunken sailor with twenty lashes, to show that he must have a sober crew.